#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>
QT_BEGIN_NAMESPACE
namespace Ui { class Dialog; }
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT
public:
    void dragEnterEvent(QDragEnterEvent*event) Q_DECL_OVERRIDE;
    //void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
    void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
private:
    //bool eventFilter(QObject *obj,QEvent *event) override;
private:
    QByteArray arrDataBoot;
    QByteArray arrDataApp1;
    QByteArray arrDataApp2;

    QString newPath;

    void initUI();
    void show_log(QString str);
    void show_log(QString str,bool isShowTime);
    void syncNewPath(QString path);
    bool saveFileData(const QString &aFileName,QByteArray &array);
    bool merge_boot_app1(void);
    bool merge_app1_app2(void);
public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();

private slots:
    void on_pBtnBoot_clicked();
    void on_pushApp1_clicked();
    void on_pushApp2_clicked();
    void on_pBtnOutput_clicked();
    void on_pBtnOk_clicked();

    void on_rBtnMode1_clicked(bool checked);

    void on_rBtnMode2_clicked(bool checked);

private:
    Ui::Dialog *ui;
};
#endif // DIALOG_H
